<template>
  <div id="app">
    <div class="back">
      <div class="mask">
      <router-view class="display" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'App',
  created() {
    window.addEventListener('beforeunload', () => {
      localStorage.setItem('messageStore', JSON.stringify(this.$store.state))
    })

    // 在页面加载时读取localStorage里的状态信息
    localStorage.getItem('messageStore') && this.$store.replaceState(Object.assign(this.$store.state, JSON.parse(localStorage.getItem('messageStore'))))
  }
}
</script>

<style lang="scss" scoped>
.back{
  height: 100%;
  background-image: url("./assets/back/back11.jpg");
  background-size: 100% 100%;
  .mask{
    height: 100%;
    background:rgba(0,0,0,0.3);
  }
}
</style>
